<template>
  <div id="AllOrder">
    <p class="AllOrder_title">{{ title }}</p>
    <div class="top">
      <p style="width: 30%;">
        <img src="@/assets/index/more.png" alt="" class="top_img">
        项目名称
      </p>
      <p style="width: 20%;">时间</p>
      <p style="width: 20%;">类型</p>
      <p style="width: 20%;">数量</p>
    </div>
    <div v-for="item in list" :key="item.order_id" class="main" @click="location(item.order_id, item.order_type)">
      <p style="width: 30%;">
        <img v-if="item.order_type == '入库'" src="@/assets/index/ruku.png" alt="">
        <img v-if="item.order_type == '出库'" src="@/assets/index/chuku.png" alt="">
        <el-tooltip v-if="item.ifName" :content="item.allName" placement="bottom" effect="light">
          <span class="project_name">{{ item.project_name }}</span>
        </el-tooltip>
        <span v-if="item.ifName === false">{{ item.project_name }}</span>
      </p>
      <p style="width: 20%;">{{ item.format_time }}</p>
      <p style="width: 20%;">{{ item.order_type }}</p>
      <p style="width: 20%;">{{ item.goods_number }}</p>
    </div>
  </div>
</template>

<script>
export default {
  name: 'PanelGroup',
  props: ['list', 'title'],
  data() {
    return {
      location(id, type) {
        if (type === '出库') {
          this.$router.push({
            path: 'storehouse/warehouseOut2',
            query: {
              id: id
            }
          })
        } else {
          this.$router.push({
            path: 'storehouse/warehousing2',
            query: {
              id: id
            }
          })
        }
      }
    }
  }
}
</script>

<style lang="scss" scoped>
#AllOrder {
  width: 100%;
  height: 464px;
  position: relative;

  .AllOrder_title {
    text-align: left;
    position: relative;
    left: 24px;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
  }

  .top {
    width: 98%;
    height: 48px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 1);
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    margin-left: 24px;
    margin-top: 16px;

    p {
      position: relative;
      display: flex;
      font-size: 14px;
      font-weight: 600;
      justify-content: center;
      align-items: center;

      .top_img {
        width: 24px;
        height: 24px;
        position: absolute;
        left: -1px;
        // left: -35px;
        top: -3px;
      }
    }
  }

  .main {
    width: 98%;
    height: 48px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 1);
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    margin-left: 24px;
    margin-top: 16px;

    p {
      position: relative;
      font-size: 14px;

      img {
        width: 24px;
        height: 24px;
        position: absolute;
        left: 0px;
        // left: -13px;
        top: -3px;
      }

      span {
        position: relative;
        left: 16px;
      }
    }

    .project_name {
      width: 80px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      display: inline-block;
    }
  }
}
#AllOrder .main p {
  text-align: center;
}
</style>
